package mysql

import "gorm.io/gorm"

type Type struct {
	gorm.Model
	TypeName string `gorm:"type:varchar(50);not null;commit:分类名称'"`
}

func (t *Type) TypeAdd(db *gorm.DB) error {
	return db.Debug().Create(t).Error
}

func (t *Type) TypeFind(db *gorm.DB, id int64) error {
	return db.Debug().Where("id=?", id).First(t).Error
}
